import { Tree } from 'antd';
import { DownOutlined } from '@ant-design/icons';
import React from 'react';
import {createHashHistory} from "history";
import {PRIVATE_ROUTE} from "../../route.constants";
 export default class SidebarTreeMenu extends React.Component {
    onSelect = (selectedKeys, info) => {
        let history = createHashHistory()
        history.push({
            pathname: '/main/'+PRIVATE_ROUTE[info.node.code]
        });
        history.go();

    };



     render() {
        return (
            <Tree
                showLine
                switcherIcon={<DownOutlined />}
                defaultExpandAll
                onSelect={this.onSelect}
                treeData={this.props.data}
            />
        );
    }
}

